<template>
   <div class="product_box">
     <!-- <el-image :src="product.thumbnail" style="width: 150px;height: 150px"></el-image> -->
     <div class="product_info">
       <div>
         <span class="product_info_title">{{ product.name }}</span>
         <span class="product_info_sn">{{product.sn}}</span>
       </div>
       <div class="product_info_bottom">
         <span class="product_info_price">¥{{ product.price }}</span>
         <span class="product_info_stock">库存 {{ product.stock }}</span>
       </div>
     </div>
   </div>
</template>

<script>

export default {
  data(){
    return{

    }
  },
  props:[
    'product'
  ]
}
</script>

<style scoped>
  .product_box{
    width: 140px;
    background-color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
    border-radius: 4px;
    box-sizing: border-box;
    overflow: hidden;
    height: 70px;
  }
  .product_info{
    display: flex;
    flex-direction: column;
    padding-top: 8px;
    padding-left: 10px;
    padding-right: 10px;
    padding-bottom: 8px;
    box-sizing: border-box;
    height: 70px;
    justify-content: space-between;
  }
  .product_info_bottom{
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
  }
  .product_info_title{
    font-size: 14px;
    font-weight: bold;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    display: block;
  }
  .product_info_price{
    font-size: 12px;
    color: red;
    font-weight: bold;
  }
  .product_info_stock{
    font-size: 12px;
    color: #909399;
  }
  .product_info_sn{
    font-size: 12px;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    display: block;
    margin-top: 2px;
    color: #909399;
  }
</style>
